EnumTranslatable

SubInterface of Translatable for use with Enums

If a non-Enum extends this, the game will crash

The default translationKey will be in the form "<prefix>.CONSTANT". Example: TestEnum.TEST

The default descriptionKey will be in the form "<prefix>.CONSTANT.desc". Example: TestEnum.TEST.desc

The default prefixKey will be in the form "<prefix>.CONSTANT.prefix". Example: TestEnum.TEST.prefix

Author

fzzyhmstrs

Since

0.2.0

Inheritors

Functions

Link copied to clipboard
open fun description(fallback: String? = null): MutableText

The translated Text description from the descriptionKey. Falls back to an empty string so no tooltip is rendered.

Link copied to clipboard
open override fun descriptionKey(): String

Override of descriptionKey that utilized the prefix and enum constant name

Link copied to clipboard
open fun descriptionOrNull(fallback: String? = null): MutableText?

The translated Text description from the descriptionKey. Falls back to an empty string so no tooltip is rendered. If no translation exists when called returns null.

Link copied to clipboard

Whether this Translatable has a valid description

Link copied to clipboard
open fun hasPrefix(): Boolean

Whether this Translatable has a valid prefix

Link copied to clipboard

Whether this Translatable has a valid translation

Link copied to clipboard
open fun prefix(): String

Defines the prefix of the translation/description key

open fun prefix(fallback: String? = null): MutableText

The translated Text description from the descriptionKey. Falls back to an empty string so no tooltip is rendered.

Link copied to clipboard
open override fun prefixKey(): String

Override of descriptionKey that utilized the prefix and enum constant name

Link copied to clipboard
open fun prefixOrNull(fallback: String? = null): MutableText?

The translated Text description from the descriptionKey. Falls back to an empty string so no tooltip is rendered. If no translation exists when called returns null.

Link copied to clipboard
open override fun translation(fallback: String?): MutableText

Override of translation that falls back to the enum constant name. Example "TEST"

Link copied to clipboard
open override fun translationKey(): String

Override of translationKey that utilized the prefix and enum constant name

Link copied to clipboard
open fun translationOrNull(fallback: String? = null): MutableText?

The translated Text name from the translationKey. Falls back to the implementing classes Simple Name (non-translated). If no translation exists when called returns null.